import { createRouter, createWebHistory } from 'vue-router'

import layout from '@/views/layout/index.vue';
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: layout,
      children: [
        // 首页路由
        {
          path: '/home',
          name: 'name',
          component: () => import('@/views/home/index.vue')
        },
        // 课程管理路由
        {
          path: '/cmt',
          name: 'courseManagement',
          component: () => import('@/views/cmt/index.vue')
        },

        // 订单路由
        {
          path: '/order',
          name: 'order',
          component: () => import('@/views/order/index.vue')
        },
        // 退款路由
        {
          path: '/refund',
          name: 'refund',
          component: () => import('@/views/refund/index.vue')
        },
        // 用户管理路由

        // 学员路由
        {
          path: '/student',
          name: 'student',
          component: () => import('@/views/student/index.vue')
        },
        // 讲师路由
        {
          path: '/lecturer',
          name: 'lecturer',
          component: () => import('@/views/lecturer/index.vue')
        },
        // 轮播图路由
        {
          path: 'swiper',
          name: 'swiper',
          component: () => import('@/views/swiper/index.vue')
        },
        {
          path: 'addswiper',
          name: 'addswiper',
          component: () => import('@/views/AddSwiper/AddSwiper.vue')
        },
        // 文章路由
        {
          path: 'article',
          name: 'article',
          component: () => import('@/views/article/index.vue')
        },
        {
          path: 'addarticle',
          name: 'addarticle',
          component: () => import('@/views/AddArticle/AddArticle.vue')
        },
        // 秒杀活动路由
        {
          path: '/flashSaleActivity',
          name: 'flashSaleActivity',
          component: () => import('@/views/flashSaleActivity/index.vue')
        },
        // 优惠券路由
        {
          path: '/coupon',
          name: 'coupon',
          component: () => import('@/views/coupon/index.vue')
        },
        // 系统管理路由
        {
          path: '/systemManagement',
          name: 'systemManagement',
          component: () => import('@/views/systemManagement/index.vue')
        }
      ]
    },
  ]
})

export default router
